import torch
import utils
import model.net_2 as nn2
import model.data_loader as data_loader
import pic_draw.ie_draw as ie_draw
import csv

if __name__=='__main__':
    ie_path = 'epoch_params/60epoch_random/'
    torch.cuda.set_device(1)
    device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu")

    json_path = 'experiments/base_cnn_2layer/params.json'
    params = utils.Params(json_path)
    params.cuda = torch.cuda.is_available()
    print('the gpu is {}'.format(params.cuda))
    print('the current gpu is {}'.format(torch.cuda.current_device()))
    model = nn2.Net(params)

    dev_dl = data_loader.fetch_dataloader('dev', params)
    ie_curve, ie_label = ie_draw.ie_picnum(ie_path, model, params, dev_dl, device, 3)
    print(ie_label)
    print(ie_curve)